<!DOCTYPE html>

<html>
  <head>
    <meta charset="utf-8">
    
    <title>Legacy Random Generation &mdash; NumPy v1.18 Manual</title>
    
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-bootstrap.css">
    <link rel="stylesheet" type="text/css" href="../../_static/css/spc-extend.css">
    <link rel="stylesheet" href="../../_static/scipy.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" >
    <link rel="stylesheet" href="../../_static/graphviz.css" type="text/css" >
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../',
        VERSION:     '1.18.1',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  false
      };
    </script>
    <script type="text/javascript" src="../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../_static/doctools.js"></script>
    <script type="text/javascript" src="../../_static/language_data.js"></script>
    <script type="text/javascript" src="../../_static/js/copybutton.js"></script>
    <link rel="author" title="About these documents" href="../../about.html" >
    <link rel="index" title="Index" href="../../genindex.html" >
    <link rel="search" title="Search" href="../../search.html" >
    <link rel="top" title="NumPy v1.18 Manual" href="../../index.html" >
    <link rel="up" title="Random sampling (numpy.random)" href="index.html" >
    <link rel="next" title="numpy.random.RandomState.get_state" href="generated/numpy.random.RandomState.get_state.html" >
    <link rel="prev" title="numpy.random.Generator.zipf" href="generated/numpy.random.Generator.zipf.html" > 
  </head>
  <body>
<div class="container">
  <div class="top-scipy-org-logo-header" style="background-color: #a2bae8;">
    <a href="../../index.html">
      <img border=0 alt="NumPy" src="../../_static/numpy_logo.png"></a>
    </div>
  </div>
</div>


    <div class="container">
      <div class="main">
        
	<div class="row-fluid">
	  <div class="span12">
	    <div class="spc-navbar">
              
    <ul class="nav nav-pills pull-left">
        <li class="active"><a href="https://numpy.org/">NumPy.org</a></li>
        <li class="active"><a href="https://numpy.org/doc">Docs</a></li>
        
        <li class="active"><a href="../../index.html">NumPy v1.18 Manual</a></li>
        

          <li class="active"><a href="../index.html" >NumPy Reference</a></li>
          <li class="active"><a href="../routines.html" >Routines</a></li>
          <li class="active"><a href="index.html" accesskey="U">Random sampling (<code class="xref py py-mod docutils literal notranslate"><span class="pre">numpy.random</span></code>)</a></li> 
    </ul>
              
              
    <ul class="nav nav-pills pull-right">
      <li class="active">
        <a href="../../genindex.html" title="General Index"
           accesskey="I">index</a>
      </li>
      <li class="active">
        <a href="generated/numpy.random.RandomState.get_state.html" title="numpy.random.RandomState.get_state"
           accesskey="N">next</a>
      </li>
      <li class="active">
        <a href="generated/numpy.random.Generator.zipf.html" title="numpy.random.Generator.zipf"
           accesskey="P">previous</a>
      </li>
    </ul>
              
	    </div>
	  </div>
	</div>
        

	<div class="row-fluid">
      <div class="spc-rightsidebar span3">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../contents.html">Table of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Legacy Random Generation</a><ul>
<li><a class="reference internal" href="#seeding-and-state">Seeding and State</a></li>
<li><a class="reference internal" href="#simple-random-data">Simple random data</a></li>
<li><a class="reference internal" href="#permutations">Permutations</a></li>
<li><a class="reference internal" href="#distributions">Distributions</a></li>
<li><a class="reference internal" href="#functions-in-numpy-random">Functions in <code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.random</span></code></a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="generated/numpy.random.Generator.zipf.html"
                        title="previous chapter">numpy.random.Generator.zipf</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="generated/numpy.random.RandomState.get_state.html"
                        title="next chapter">numpy.random.RandomState.get_state</a></p>
<div id="searchbox" style="display: none" role="search">
  <h4>Quick search</h4>
    <div>
    <form class="search" action="../../search.html" method="get">
      <input type="text" style="width: inherit;" name="q" />
      <input type="submit" value="search" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    </div>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
          <div class="span9">
            
        <div class="bodywrapper">
          <div class="body" id="spc-section-body">
            
  <div class="section" id="legacy-random-generation">
<span id="legacy"></span><h1>Legacy Random Generation<a class="headerlink" href="#legacy-random-generation" title="Permalink to this headline">¶</a></h1>
<p>The <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> provides access to
legacy generators. This generator is considered frozen and will have
no further improvements.  It is guaranteed to produce the same values
as the final point release of NumPy v1.16. These all depend on Box-Muller
normals or inverse CDF exponentials or gammas. This class should only be used
if it is essential to have randoms that are identical to what
would have been produced by previous versions of NumPy.</p>
<p><a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> adds additional information
to the state which is required when using Box-Muller normals since these
are produced in pairs. It is important to use
<a class="reference internal" href="generated/numpy.random.RandomState.get_state.html#numpy.random.RandomState.get_state" title="numpy.random.RandomState.get_state"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState.get_state</span></code></a>, and not the underlying bit generators
<em class="xref py py-obj">state</em>, when accessing the state so that these extra values are saved.</p>
<p>Although we provide the <a class="reference internal" href="bit_generators/mt19937.html#numpy.random.MT19937" title="numpy.random.MT19937"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MT19937</span></code></a> BitGenerator for use independent of
<a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a>, note that its default seeding uses <a class="reference internal" href="bit_generators/generated/numpy.random.SeedSequence.html#numpy.random.SeedSequence" title="numpy.random.SeedSequence"><code class="xref py py-obj docutils literal notranslate"><span class="pre">SeedSequence</span></code></a>
rather than the legacy seeding algorithm. <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> will use the
legacy seeding algorithm. The methods to use the legacy seeding algorithm are
currently private as the main reason to use them is just to implement
<a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a>. However, one can reset the state of <a class="reference internal" href="bit_generators/mt19937.html#numpy.random.MT19937" title="numpy.random.MT19937"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MT19937</span></code></a>
using the state of the <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a>:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="kn">from</span> <span class="nn">numpy.random</span> <span class="kn">import</span> <span class="n">MT19937</span>
<span class="kn">from</span> <span class="nn">numpy.random</span> <span class="kn">import</span> <span class="n">RandomState</span>

<span class="n">rs</span> <span class="o">=</span> <span class="n">RandomState</span><span class="p">(</span><span class="mi">12345</span><span class="p">)</span>
<span class="n">mt19937</span> <span class="o">=</span> <span class="n">MT19937</span><span class="p">()</span>
<span class="n">mt19937</span><span class="o">.</span><span class="n">state</span> <span class="o">=</span> <span class="n">rs</span><span class="o">.</span><span class="n">get_state</span><span class="p">()</span>
<span class="n">rs2</span> <span class="o">=</span> <span class="n">RandomState</span><span class="p">(</span><span class="n">mt19937</span><span class="p">)</span>

<span class="c1"># Same output</span>
<span class="n">rs</span><span class="o">.</span><span class="n">standard_normal</span><span class="p">()</span>
<span class="n">rs2</span><span class="o">.</span><span class="n">standard_normal</span><span class="p">()</span>

<span class="n">rs</span><span class="o">.</span><span class="n">random</span><span class="p">()</span>
<span class="n">rs2</span><span class="o">.</span><span class="n">random</span><span class="p">()</span>

<span class="n">rs</span><span class="o">.</span><span class="n">standard_exponential</span><span class="p">()</span>
<span class="n">rs2</span><span class="o">.</span><span class="n">standard_exponential</span><span class="p">()</span>
</pre></div>
</div>
<dl class="class">
<dt id="numpy.random.RandomState">
<em class="property">class </em><code class="sig-prename descclassname">numpy.random.</code><code class="sig-name descname">RandomState</code><span class="sig-paren">(</span><em class="sig-param">seed=None</em><span class="sig-paren">)</span><a class="headerlink" href="#numpy.random.RandomState" title="Permalink to this definition">¶</a></dt>
<dd><p>Container for the slow Mersenne Twister pseudo-random number generator.
Consider using a different BitGenerator with the Generator container
instead.</p>
<p><a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> and <a class="reference internal" href="generator.html#numpy.random.Generator" title="numpy.random.Generator"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Generator</span></code></a> expose a number of methods for generating
random numbers drawn from a variety of probability distributions. In
addition to the distribution-specific arguments, each method takes a
keyword argument <em class="xref py py-obj">size</em> that defaults to <code class="docutils literal notranslate"><span class="pre">None</span></code>. If <em class="xref py py-obj">size</em> is <code class="docutils literal notranslate"><span class="pre">None</span></code>,
then a single value is generated and returned. If <em class="xref py py-obj">size</em> is an integer,
then a 1-D array filled with generated values is returned. If <em class="xref py py-obj">size</em> is a
tuple, then an array with that shape is filled and returned.</p>
<p><strong>Compatibility Guarantee</strong></p>
<p>A fixed bit generator using a fixed seed and a fixed series of calls to
‘RandomState’ methods using the same parameters will always produce the
same results up to roundoff error except when the values were incorrect.
<a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> is effectively frozen and will only receive updates that
are required by changes in the the internals of Numpy. More substantial
changes, including algorithmic improvements, are reserved for
<a class="reference internal" href="generator.html#numpy.random.Generator" title="numpy.random.Generator"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Generator</span></code></a>.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>seed</strong><span class="classifier">{None, int, array_like, BitGenerator}, optional</span></dt><dd><p>Random seed used to initialize the pseudo-random number generator or
an instantized BitGenerator.  If an integer or array, used as a seed for
the MT19937 BitGenerator. Values can be any integer between 0 and
2**32 - 1 inclusive, an array (or other sequence) of such integers,
or <code class="docutils literal notranslate"><span class="pre">None</span></code> (the default).  If <a class="reference internal" href="generated/numpy.random.seed.html#numpy.random.seed" title="numpy.random.seed"><code class="xref py py-obj docutils literal notranslate"><span class="pre">seed</span></code></a> is <code class="docutils literal notranslate"><span class="pre">None</span></code>, then the <a class="reference internal" href="bit_generators/mt19937.html#numpy.random.MT19937" title="numpy.random.MT19937"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MT19937</span></code></a>
BitGenerator is initialized by reading data from <code class="docutils literal notranslate"><span class="pre">/dev/urandom</span></code>
(or the Windows analogue) if available or seed from the clock
otherwise.</p>
</dd>
</dl>
</dd>
</dl>
<div class="admonition seealso">
<p class="admonition-title">See also</p>
<p><a class="reference internal" href="generator.html#numpy.random.Generator" title="numpy.random.Generator"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Generator</span></code></a>, <a class="reference internal" href="bit_generators/mt19937.html#numpy.random.MT19937" title="numpy.random.MT19937"><code class="xref py py-obj docutils literal notranslate"><span class="pre">MT19937</span></code></a>, <a class="reference internal" href="bit_generators/generated/numpy.random.BitGenerator.html#numpy.random.BitGenerator" title="numpy.random.BitGenerator"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.random.BitGenerator</span></code></a></p>
</div>
<p class="rubric">Notes</p>
<p>The Python stdlib module “random” also contains a Mersenne Twister
pseudo-random number generator with a number of methods that are similar
to the ones available in <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a>. <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a>, besides being
NumPy-aware, has the advantage that it provides a much larger number
of probability distributions to choose from.</p>
</dd></dl>

<div class="section" id="seeding-and-state">
<h2>Seeding and State<a class="headerlink" href="#seeding-and-state" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.get_state.html#numpy.random.RandomState.get_state" title="numpy.random.RandomState.get_state"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_state</span></code></a>()</p></td>
<td><p>Return a tuple representing the internal state of the generator.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.set_state.html#numpy.random.RandomState.set_state" title="numpy.random.RandomState.set_state"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_state</span></code></a>(state)</p></td>
<td><p>Set the internal state of the generator from a tuple.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.seed.html#numpy.random.RandomState.seed" title="numpy.random.RandomState.seed"><code class="xref py py-obj docutils literal notranslate"><span class="pre">seed</span></code></a>(self[, seed])</p></td>
<td><p>Reseed a legacy MT19937 BitGenerator</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="simple-random-data">
<h2>Simple random data<a class="headerlink" href="#simple-random-data" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.rand.html#numpy.random.RandomState.rand" title="numpy.random.RandomState.rand"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rand</span></code></a>(d0, d1, …, dn)</p></td>
<td><p>Random values in a given shape.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.randn.html#numpy.random.RandomState.randn" title="numpy.random.RandomState.randn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">randn</span></code></a>(d0, d1, …, dn)</p></td>
<td><p>Return a sample (or samples) from the “standard normal” distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.randint.html#numpy.random.RandomState.randint" title="numpy.random.RandomState.randint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">randint</span></code></a>(low[, high, size, dtype])</p></td>
<td><p>Return random integers from <em class="xref py py-obj">low</em> (inclusive) to <em class="xref py py-obj">high</em> (exclusive).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.random_integers.html#numpy.random.RandomState.random_integers" title="numpy.random.RandomState.random_integers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_integers</span></code></a>(low[, high, size])</p></td>
<td><p>Random integers of type <em class="xref py py-obj">np.int_</em> between <em class="xref py py-obj">low</em> and <em class="xref py py-obj">high</em>, inclusive.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.random_sample.html#numpy.random.RandomState.random_sample" title="numpy.random.RandomState.random_sample"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_sample</span></code></a>([size])</p></td>
<td><p>Return random floats in the half-open interval [0.0, 1.0).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.choice.html#numpy.random.RandomState.choice" title="numpy.random.RandomState.choice"><code class="xref py py-obj docutils literal notranslate"><span class="pre">choice</span></code></a>(a[, size, replace, p])</p></td>
<td><p>Generates a random sample from a given 1-D array</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.bytes.html#numpy.random.RandomState.bytes" title="numpy.random.RandomState.bytes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bytes</span></code></a>(length)</p></td>
<td><p>Return random bytes.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="permutations">
<h2>Permutations<a class="headerlink" href="#permutations" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.shuffle.html#numpy.random.RandomState.shuffle" title="numpy.random.RandomState.shuffle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">shuffle</span></code></a>(x)</p></td>
<td><p>Modify a sequence in-place by shuffling its contents.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.permutation.html#numpy.random.RandomState.permutation" title="numpy.random.RandomState.permutation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">permutation</span></code></a>(x)</p></td>
<td><p>Randomly permute a sequence, or return a permuted range.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="distributions">
<h2>Distributions<a class="headerlink" href="#distributions" title="Permalink to this headline">¶</a></h2>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.beta.html#numpy.random.RandomState.beta" title="numpy.random.RandomState.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a>(a, b[, size])</p></td>
<td><p>Draw samples from a Beta distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.binomial.html#numpy.random.RandomState.binomial" title="numpy.random.RandomState.binomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">binomial</span></code></a>(n, p[, size])</p></td>
<td><p>Draw samples from a binomial distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.chisquare.html#numpy.random.RandomState.chisquare" title="numpy.random.RandomState.chisquare"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chisquare</span></code></a>(df[, size])</p></td>
<td><p>Draw samples from a chi-square distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.dirichlet.html#numpy.random.RandomState.dirichlet" title="numpy.random.RandomState.dirichlet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dirichlet</span></code></a>(alpha[, size])</p></td>
<td><p>Draw samples from the Dirichlet distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.exponential.html#numpy.random.RandomState.exponential" title="numpy.random.RandomState.exponential"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exponential</span></code></a>([scale, size])</p></td>
<td><p>Draw samples from an exponential distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.f.html#numpy.random.RandomState.f" title="numpy.random.RandomState.f"><code class="xref py py-obj docutils literal notranslate"><span class="pre">f</span></code></a>(dfnum, dfden[, size])</p></td>
<td><p>Draw samples from an F distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.gamma.html#numpy.random.RandomState.gamma" title="numpy.random.RandomState.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a>(shape[, scale, size])</p></td>
<td><p>Draw samples from a Gamma distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.geometric.html#numpy.random.RandomState.geometric" title="numpy.random.RandomState.geometric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geometric</span></code></a>(p[, size])</p></td>
<td><p>Draw samples from the geometric distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.gumbel.html#numpy.random.RandomState.gumbel" title="numpy.random.RandomState.gumbel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gumbel</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from a Gumbel distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.hypergeometric.html#numpy.random.RandomState.hypergeometric" title="numpy.random.RandomState.hypergeometric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hypergeometric</span></code></a>(ngood, nbad, nsample[, size])</p></td>
<td><p>Draw samples from a Hypergeometric distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.laplace.html#numpy.random.RandomState.laplace" title="numpy.random.RandomState.laplace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.logistic.html#numpy.random.RandomState.logistic" title="numpy.random.RandomState.logistic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">logistic</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from a logistic distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.lognormal.html#numpy.random.RandomState.lognormal" title="numpy.random.RandomState.lognormal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lognormal</span></code></a>([mean, sigma, size])</p></td>
<td><p>Draw samples from a log-normal distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.logseries.html#numpy.random.RandomState.logseries" title="numpy.random.RandomState.logseries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">logseries</span></code></a>(p[, size])</p></td>
<td><p>Draw samples from a logarithmic series distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.multinomial.html#numpy.random.RandomState.multinomial" title="numpy.random.RandomState.multinomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">multinomial</span></code></a>(n, pvals[, size])</p></td>
<td><p>Draw samples from a multinomial distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.multivariate_normal.html#numpy.random.RandomState.multivariate_normal" title="numpy.random.RandomState.multivariate_normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">multivariate_normal</span></code></a>(mean, cov[, size, …])</p></td>
<td><p>Draw random samples from a multivariate normal distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.negative_binomial.html#numpy.random.RandomState.negative_binomial" title="numpy.random.RandomState.negative_binomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">negative_binomial</span></code></a>(n, p[, size])</p></td>
<td><p>Draw samples from a negative binomial distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.noncentral_chisquare.html#numpy.random.RandomState.noncentral_chisquare" title="numpy.random.RandomState.noncentral_chisquare"><code class="xref py py-obj docutils literal notranslate"><span class="pre">noncentral_chisquare</span></code></a>(df, nonc[, size])</p></td>
<td><p>Draw samples from a noncentral chi-square distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.noncentral_f.html#numpy.random.RandomState.noncentral_f" title="numpy.random.RandomState.noncentral_f"><code class="xref py py-obj docutils literal notranslate"><span class="pre">noncentral_f</span></code></a>(dfnum, dfden, nonc[, size])</p></td>
<td><p>Draw samples from the noncentral F distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.normal.html#numpy.random.RandomState.normal" title="numpy.random.RandomState.normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">normal</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw random samples from a normal (Gaussian) distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.pareto.html#numpy.random.RandomState.pareto" title="numpy.random.RandomState.pareto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pareto</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Pareto II or Lomax distribution with specified shape.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.poisson.html#numpy.random.RandomState.poisson" title="numpy.random.RandomState.poisson"><code class="xref py py-obj docutils literal notranslate"><span class="pre">poisson</span></code></a>([lam, size])</p></td>
<td><p>Draw samples from a Poisson distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.power.html#numpy.random.RandomState.power" title="numpy.random.RandomState.power"><code class="xref py py-obj docutils literal notranslate"><span class="pre">power</span></code></a>(a[, size])</p></td>
<td><p>Draws samples in [0, 1] from a power distribution with positive exponent a - 1.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.rayleigh.html#numpy.random.RandomState.rayleigh" title="numpy.random.RandomState.rayleigh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rayleigh</span></code></a>([scale, size])</p></td>
<td><p>Draw samples from a Rayleigh distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.standard_cauchy.html#numpy.random.RandomState.standard_cauchy" title="numpy.random.RandomState.standard_cauchy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_cauchy</span></code></a>([size])</p></td>
<td><p>Draw samples from a standard Cauchy distribution with mode = 0.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.standard_exponential.html#numpy.random.RandomState.standard_exponential" title="numpy.random.RandomState.standard_exponential"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_exponential</span></code></a>([size])</p></td>
<td><p>Draw samples from the standard exponential distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.standard_gamma.html#numpy.random.RandomState.standard_gamma" title="numpy.random.RandomState.standard_gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_gamma</span></code></a>(shape[, size])</p></td>
<td><p>Draw samples from a standard Gamma distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.standard_normal.html#numpy.random.RandomState.standard_normal" title="numpy.random.RandomState.standard_normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_normal</span></code></a>([size])</p></td>
<td><p>Draw samples from a standard Normal distribution (mean=0, stdev=1).</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.standard_t.html#numpy.random.RandomState.standard_t" title="numpy.random.RandomState.standard_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_t</span></code></a>(df[, size])</p></td>
<td><p>Draw samples from a standard Student’s t distribution with <em class="xref py py-obj">df</em> degrees of freedom.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.triangular.html#numpy.random.RandomState.triangular" title="numpy.random.RandomState.triangular"><code class="xref py py-obj docutils literal notranslate"><span class="pre">triangular</span></code></a>(left, mode, right[, size])</p></td>
<td><p>Draw samples from the triangular distribution over the interval <code class="docutils literal notranslate"><span class="pre">[left,</span> <span class="pre">right]</span></code>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.uniform.html#numpy.random.RandomState.uniform" title="numpy.random.RandomState.uniform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uniform</span></code></a>([low, high, size])</p></td>
<td><p>Draw samples from a uniform distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.vonmises.html#numpy.random.RandomState.vonmises" title="numpy.random.RandomState.vonmises"><code class="xref py py-obj docutils literal notranslate"><span class="pre">vonmises</span></code></a>(mu, kappa[, size])</p></td>
<td><p>Draw samples from a von Mises distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.wald.html#numpy.random.RandomState.wald" title="numpy.random.RandomState.wald"><code class="xref py py-obj docutils literal notranslate"><span class="pre">wald</span></code></a>(mean, scale[, size])</p></td>
<td><p>Draw samples from a Wald, or inverse Gaussian, distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.weibull.html#numpy.random.RandomState.weibull" title="numpy.random.RandomState.weibull"><code class="xref py py-obj docutils literal notranslate"><span class="pre">weibull</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Weibull distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.RandomState.zipf.html#numpy.random.RandomState.zipf" title="numpy.random.RandomState.zipf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zipf</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Zipf distribution.</p></td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="functions-in-numpy-random">
<h2>Functions in <a class="reference internal" href="index.html#module-numpy.random" title="numpy.random"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.random</span></code></a><a class="headerlink" href="#functions-in-numpy-random" title="Permalink to this headline">¶</a></h2>
<p>Many of the RandomState methods above are exported as functions in
<a class="reference internal" href="index.html#module-numpy.random" title="numpy.random"><code class="xref py py-obj docutils literal notranslate"><span class="pre">numpy.random</span></code></a> This usage is discouraged, as it is implemented via a gloabl
<a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> instance which is not advised on two counts:</p>
<ul class="simple">
<li><p>It uses global state, which means results will change as the code changes</p></li>
<li><p>It uses a <a class="reference internal" href="#numpy.random.RandomState" title="numpy.random.RandomState"><code class="xref py py-obj docutils literal notranslate"><span class="pre">RandomState</span></code></a> rather than the more modern <a class="reference internal" href="generator.html#numpy.random.Generator" title="numpy.random.Generator"><code class="xref py py-obj docutils literal notranslate"><span class="pre">Generator</span></code></a>.</p></li>
</ul>
<p>For backward compatible legacy reasons, we cannot change this. See
<em class="xref py py-obj">random-quick-start</em>.</p>
<table class="longtable docutils align-default">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.beta.html#numpy.random.beta" title="numpy.random.beta"><code class="xref py py-obj docutils literal notranslate"><span class="pre">beta</span></code></a>(a, b[, size])</p></td>
<td><p>Draw samples from a Beta distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.binomial.html#numpy.random.binomial" title="numpy.random.binomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">binomial</span></code></a>(n, p[, size])</p></td>
<td><p>Draw samples from a binomial distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.bytes.html#numpy.random.bytes" title="numpy.random.bytes"><code class="xref py py-obj docutils literal notranslate"><span class="pre">bytes</span></code></a>(length)</p></td>
<td><p>Return random bytes.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.chisquare.html#numpy.random.chisquare" title="numpy.random.chisquare"><code class="xref py py-obj docutils literal notranslate"><span class="pre">chisquare</span></code></a>(df[, size])</p></td>
<td><p>Draw samples from a chi-square distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.choice.html#numpy.random.choice" title="numpy.random.choice"><code class="xref py py-obj docutils literal notranslate"><span class="pre">choice</span></code></a>(a[, size, replace, p])</p></td>
<td><p>Generates a random sample from a given 1-D array</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.dirichlet.html#numpy.random.dirichlet" title="numpy.random.dirichlet"><code class="xref py py-obj docutils literal notranslate"><span class="pre">dirichlet</span></code></a>(alpha[, size])</p></td>
<td><p>Draw samples from the Dirichlet distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.exponential.html#numpy.random.exponential" title="numpy.random.exponential"><code class="xref py py-obj docutils literal notranslate"><span class="pre">exponential</span></code></a>([scale, size])</p></td>
<td><p>Draw samples from an exponential distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.f.html#numpy.random.f" title="numpy.random.f"><code class="xref py py-obj docutils literal notranslate"><span class="pre">f</span></code></a>(dfnum, dfden[, size])</p></td>
<td><p>Draw samples from an F distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.gamma.html#numpy.random.gamma" title="numpy.random.gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gamma</span></code></a>(shape[, scale, size])</p></td>
<td><p>Draw samples from a Gamma distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.geometric.html#numpy.random.geometric" title="numpy.random.geometric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">geometric</span></code></a>(p[, size])</p></td>
<td><p>Draw samples from the geometric distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.get_state.html#numpy.random.get_state" title="numpy.random.get_state"><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_state</span></code></a>()</p></td>
<td><p>Return a tuple representing the internal state of the generator.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.gumbel.html#numpy.random.gumbel" title="numpy.random.gumbel"><code class="xref py py-obj docutils literal notranslate"><span class="pre">gumbel</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from a Gumbel distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.hypergeometric.html#numpy.random.hypergeometric" title="numpy.random.hypergeometric"><code class="xref py py-obj docutils literal notranslate"><span class="pre">hypergeometric</span></code></a>(ngood, nbad, nsample[, size])</p></td>
<td><p>Draw samples from a Hypergeometric distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.laplace.html#numpy.random.laplace" title="numpy.random.laplace"><code class="xref py py-obj docutils literal notranslate"><span class="pre">laplace</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from the Laplace or double exponential distribution with specified location (or mean) and scale (decay).</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.logistic.html#numpy.random.logistic" title="numpy.random.logistic"><code class="xref py py-obj docutils literal notranslate"><span class="pre">logistic</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw samples from a logistic distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.lognormal.html#numpy.random.lognormal" title="numpy.random.lognormal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">lognormal</span></code></a>([mean, sigma, size])</p></td>
<td><p>Draw samples from a log-normal distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.logseries.html#numpy.random.logseries" title="numpy.random.logseries"><code class="xref py py-obj docutils literal notranslate"><span class="pre">logseries</span></code></a>(p[, size])</p></td>
<td><p>Draw samples from a logarithmic series distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.multinomial.html#numpy.random.multinomial" title="numpy.random.multinomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">multinomial</span></code></a>(n, pvals[, size])</p></td>
<td><p>Draw samples from a multinomial distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.multivariate_normal.html#numpy.random.multivariate_normal" title="numpy.random.multivariate_normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">multivariate_normal</span></code></a>(mean, cov[, size, …])</p></td>
<td><p>Draw random samples from a multivariate normal distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.negative_binomial.html#numpy.random.negative_binomial" title="numpy.random.negative_binomial"><code class="xref py py-obj docutils literal notranslate"><span class="pre">negative_binomial</span></code></a>(n, p[, size])</p></td>
<td><p>Draw samples from a negative binomial distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.noncentral_chisquare.html#numpy.random.noncentral_chisquare" title="numpy.random.noncentral_chisquare"><code class="xref py py-obj docutils literal notranslate"><span class="pre">noncentral_chisquare</span></code></a>(df, nonc[, size])</p></td>
<td><p>Draw samples from a noncentral chi-square distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.noncentral_f.html#numpy.random.noncentral_f" title="numpy.random.noncentral_f"><code class="xref py py-obj docutils literal notranslate"><span class="pre">noncentral_f</span></code></a>(dfnum, dfden, nonc[, size])</p></td>
<td><p>Draw samples from the noncentral F distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.normal.html#numpy.random.normal" title="numpy.random.normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">normal</span></code></a>([loc, scale, size])</p></td>
<td><p>Draw random samples from a normal (Gaussian) distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.pareto.html#numpy.random.pareto" title="numpy.random.pareto"><code class="xref py py-obj docutils literal notranslate"><span class="pre">pareto</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Pareto II or Lomax distribution with specified shape.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.permutation.html#numpy.random.permutation" title="numpy.random.permutation"><code class="xref py py-obj docutils literal notranslate"><span class="pre">permutation</span></code></a>(x)</p></td>
<td><p>Randomly permute a sequence, or return a permuted range.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.poisson.html#numpy.random.poisson" title="numpy.random.poisson"><code class="xref py py-obj docutils literal notranslate"><span class="pre">poisson</span></code></a>([lam, size])</p></td>
<td><p>Draw samples from a Poisson distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.power.html#numpy.random.power" title="numpy.random.power"><code class="xref py py-obj docutils literal notranslate"><span class="pre">power</span></code></a>(a[, size])</p></td>
<td><p>Draws samples in [0, 1] from a power distribution with positive exponent a - 1.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.rand.html#numpy.random.rand" title="numpy.random.rand"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rand</span></code></a>(d0, d1, …, dn)</p></td>
<td><p>Random values in a given shape.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.randint.html#numpy.random.randint" title="numpy.random.randint"><code class="xref py py-obj docutils literal notranslate"><span class="pre">randint</span></code></a>(low[, high, size, dtype])</p></td>
<td><p>Return random integers from <em class="xref py py-obj">low</em> (inclusive) to <em class="xref py py-obj">high</em> (exclusive).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.randn.html#numpy.random.randn" title="numpy.random.randn"><code class="xref py py-obj docutils literal notranslate"><span class="pre">randn</span></code></a>(d0, d1, …, dn)</p></td>
<td><p>Return a sample (or samples) from the “standard normal” distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.random.html#numpy.random.random" title="numpy.random.random"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random</span></code></a>([size])</p></td>
<td><p>Return random floats in the half-open interval [0.0, 1.0).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.random_integers.html#numpy.random.random_integers" title="numpy.random.random_integers"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_integers</span></code></a>(low[, high, size])</p></td>
<td><p>Random integers of type <em class="xref py py-obj">np.int_</em> between <em class="xref py py-obj">low</em> and <em class="xref py py-obj">high</em>, inclusive.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.random_sample.html#numpy.random.random_sample" title="numpy.random.random_sample"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_sample</span></code></a>([size])</p></td>
<td><p>Return random floats in the half-open interval [0.0, 1.0).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.ranf.html#numpy.random.ranf" title="numpy.random.ranf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">ranf</span></code></a>()</p></td>
<td><p>This is an alias of <a class="reference internal" href="generated/numpy.random.random_sample.html#numpy.random.random_sample" title="numpy.random.random_sample"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_sample</span></code></a>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.rayleigh.html#numpy.random.rayleigh" title="numpy.random.rayleigh"><code class="xref py py-obj docutils literal notranslate"><span class="pre">rayleigh</span></code></a>([scale, size])</p></td>
<td><p>Draw samples from a Rayleigh distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.sample.html#numpy.random.sample" title="numpy.random.sample"><code class="xref py py-obj docutils literal notranslate"><span class="pre">sample</span></code></a>()</p></td>
<td><p>This is an alias of <a class="reference internal" href="generated/numpy.random.random_sample.html#numpy.random.random_sample" title="numpy.random.random_sample"><code class="xref py py-obj docutils literal notranslate"><span class="pre">random_sample</span></code></a>.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.seed.html#numpy.random.seed" title="numpy.random.seed"><code class="xref py py-obj docutils literal notranslate"><span class="pre">seed</span></code></a>(self[, seed])</p></td>
<td><p>Reseed a legacy MT19937 BitGenerator</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.set_state.html#numpy.random.set_state" title="numpy.random.set_state"><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_state</span></code></a>(state)</p></td>
<td><p>Set the internal state of the generator from a tuple.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.shuffle.html#numpy.random.shuffle" title="numpy.random.shuffle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">shuffle</span></code></a>(x)</p></td>
<td><p>Modify a sequence in-place by shuffling its contents.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.standard_cauchy.html#numpy.random.standard_cauchy" title="numpy.random.standard_cauchy"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_cauchy</span></code></a>([size])</p></td>
<td><p>Draw samples from a standard Cauchy distribution with mode = 0.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.standard_exponential.html#numpy.random.standard_exponential" title="numpy.random.standard_exponential"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_exponential</span></code></a>([size])</p></td>
<td><p>Draw samples from the standard exponential distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.standard_gamma.html#numpy.random.standard_gamma" title="numpy.random.standard_gamma"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_gamma</span></code></a>(shape[, size])</p></td>
<td><p>Draw samples from a standard Gamma distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.standard_normal.html#numpy.random.standard_normal" title="numpy.random.standard_normal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_normal</span></code></a>([size])</p></td>
<td><p>Draw samples from a standard Normal distribution (mean=0, stdev=1).</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.standard_t.html#numpy.random.standard_t" title="numpy.random.standard_t"><code class="xref py py-obj docutils literal notranslate"><span class="pre">standard_t</span></code></a>(df[, size])</p></td>
<td><p>Draw samples from a standard Student’s t distribution with <em class="xref py py-obj">df</em> degrees of freedom.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.triangular.html#numpy.random.triangular" title="numpy.random.triangular"><code class="xref py py-obj docutils literal notranslate"><span class="pre">triangular</span></code></a>(left, mode, right[, size])</p></td>
<td><p>Draw samples from the triangular distribution over the interval <code class="docutils literal notranslate"><span class="pre">[left,</span> <span class="pre">right]</span></code>.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.uniform.html#numpy.random.uniform" title="numpy.random.uniform"><code class="xref py py-obj docutils literal notranslate"><span class="pre">uniform</span></code></a>([low, high, size])</p></td>
<td><p>Draw samples from a uniform distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.vonmises.html#numpy.random.vonmises" title="numpy.random.vonmises"><code class="xref py py-obj docutils literal notranslate"><span class="pre">vonmises</span></code></a>(mu, kappa[, size])</p></td>
<td><p>Draw samples from a von Mises distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.wald.html#numpy.random.wald" title="numpy.random.wald"><code class="xref py py-obj docutils literal notranslate"><span class="pre">wald</span></code></a>(mean, scale[, size])</p></td>
<td><p>Draw samples from a Wald, or inverse Gaussian, distribution.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="generated/numpy.random.weibull.html#numpy.random.weibull" title="numpy.random.weibull"><code class="xref py py-obj docutils literal notranslate"><span class="pre">weibull</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Weibull distribution.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="generated/numpy.random.zipf.html#numpy.random.zipf" title="numpy.random.zipf"><code class="xref py py-obj docutils literal notranslate"><span class="pre">zipf</span></code></a>(a[, size])</p></td>
<td><p>Draw samples from a Zipf distribution.</p></td>
</tr>
</tbody>
</table>
</div>
</div>


          </div>
        </div>
          </div>
        </div>
      </div>
    </div>

    <div class="container container-navbar-bottom">
      <div class="spc-navbar">
        
      </div>
    </div>
    <div class="container">
    <div class="footer">
    <div class="row-fluid">
    <ul class="inline pull-left">
      <li>
        &copy; Copyright 2008-2019, The SciPy community.
      </li>
      <li>
      Last updated on Feb 20, 2020.
      </li>
      <li>
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 2.4.2.
      </li>
    </ul>
    </div>
    </div>
    </div>
  </body>
</html>